CREATE TABLE jms_dws.dws_cusc_demand_taking_network_summary
(
    taking_early_scansitecode varchar(50)   COMMENT '第一次揽收网点code',
    taking_agent_code         varchar(50)   COMMENT '揽收网点所属代理区code',
    taking_fran_code          varchar(50)   COMMENT '揽收网点所属加盟商code',
    taking_early_scansitename varchar(100)  COMMENT '第一次揽收网点名称',
    taking_agent_name         varchar(100)  COMMENT '揽收网点所属代理区名称',
    taking_fran_name          varchar(100)  COMMENT '揽收网点所属加盟商名称',
    taking_provider_id        varchar(50)   COMMENT '揽收网点所在省份id',
    taking_provider_desc      varchar(100)  COMMENT '揽收网点所在省份名称',
    taking_city_id            varchar(50)   COMMENT '揽收网点所在城市id',
    taking_city_desc          varchar(100)  COMMENT '揽收网点所在城市名称',
    need_call_num             int(11)       COMMENT '应电联量',
    have_call_num             int(11)       COMMENT '已电联量',
    call_rate                 double        COMMENT '电联率',
    gt6_seconds               int(11)       COMMENT '通话时长大于6秒',
    gt6_seconds_rate          double        COMMENT '6秒接通率',
    performance_bill_num      int(11)       COMMENT '履约票数',
    performance_bill_rate     double        COMMENT '履约率',
    sign_early_scantime       date          COMMENT '第一次签收时间'
) ENGINE = OLAP DUPLICATE KEY(taking_early_scansitecode, taking_agent_code, taking_fran_code)
COMMENT '按需配送揽收维度汇总(粒度网点)'
PARTITION BY RANGE(sign_early_scantime)
(START ('2023-04-01') END ('2023-06-07') EVERY (INTERVAL 1 day)
)
DISTRIBUTED BY HASH(taking_early_scansitecode) BUCKETS 4
PROPERTIES (
'replication_num' = '3',
'dynamic_partition.enable' = 'true',
'dynamic_partition.time_unit' = 'DAY',
'dynamic_partition.time_zone' = 'Asia/Shanghai',
'dynamic_partition.start' = '-180',
'dynamic_partition.end' = '4',
'dynamic_partition.prefix' = 'p',
'dynamic_partition.buckets' = '20',
'in_memory' = 'false',
'storage_format' = 'V2'
);